<template>
  <div class="allcnt">
    <div class="leftMenu" style="height:100%">
      <left-menu style="height:100%"></left-menu>
    </div>
    <div class="projcetList" style="height:100%">
      <component
        v-bind:is="currentView"
        :pkid="pkid"
        style="margin-top:18px;height:calc(100% - 33px)"
      ></component>
    </div>
  </div>
</template>
<script>
import bus from "../../assets/bus.js";
import leftMenu from "../common/LeftMenu.vue";
import monthList from "./MonthList.vue";
import allProject1 from "./AllProject1.vue";
import allProject2 from "./AllProject2.vue";
import allProject3 from "./AllProject3.vue";
import projectProgress from "./ProjectProgress.vue";
import ProjectSurvey from "./ProjectSurvey.vue"; //项目概况
// import {loginUrl} from "../tool/Global/app-config.js"
import { logoutToLogin } from "../tool/Global/app-mgr.js";
//修改为监测经协系统是否已经登陆
import { apiGetUserInfo } from "../tool/Global/app-login-module.js";
export default {
  components: {
    allProject1,
    allProject2,
    allProject3,
    projectProgress,
    leftMenu,
    monthList,
    ProjectSurvey
  },
  data: function() {
    return {
      currentView: projectProgress,
      pkid: null
    };
  },
  mounted: function() {
    this.busEvent();
    this.$nextTick(function() {
      this.$emit("itemChange", "manage");
    });
  },
  methods: {
    busEvent() {
      let self = this;
      bus.$on("changeLeftItem", function(val, pkid) {
        if (val == 1) {
          self.currentView = allProject2;
        } else if (val == 2) {//项目查询
          self.currentView = allProject1;
        } else if (val == 3) {
          self.currentView = allProject3;
        } else if (val == 4) {
          self.pkid = pkid;
          self.currentView = projectProgress;
        } else if (val == 5) {//项目进度查询
          self.currentView = monthList;
        } else if (val == 6) {
          //项目概况
          self.currentView = ProjectSurvey;
        }
      });
    }
  }
};
</script>
<style scoped>
.leftMenu {
  width: 22%;
  float: left;
}
.projcetList {
  width: 75%;
  float: left;
  margin-left: 10px;
}
.allcnt {
  overflow: hidden;
  background-color: #fff;
  height: calc(100% - 107px);
  min-height: calc(100% - 107px);
  min-height: -moz-calc(100% - 107px);
  min-height: -webkit-calc(100% - 107px);
}
</style>
<style>
.el-table thead{
   color:#555 
}
.tableHead {
  text-align: center;
}
</style>




